package com.xiaoxu.spark_base.example.SQL_Datasets_DataFrames

import org.apache.spark.sql.SparkSession
object Test {

  def main(args: Array[String]): Unit = {
    val spark = SparkSession
      .builder()
      .appName("Spark SQL basic example")
      .master("local[2]")
      .config("spark.some.config.option", "some-value")
      .getOrCreate()
// grant all privileges on *.* to root@% identified by 'root';

    val df = spark.read.json("data/practiceOperator/people.json")

    // Displays the content of the DataFrame to stdout
    df.show()
    // +----+-------+
    // | age|   name|
    // +----+-------+
    // |null|Michael|
    // |  30|   Andy|
    // |  19| Justin|
    // +----+-------+


    spark.stop()


  }


}
